﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ImageShower.ascx.vb"
    Inherits="WebUserControls_ImageShower" %>
<script type="text/javascript">
    var ImgSource = new Array()
    var currentIndex = 0;
    function setArray() {
        var arr = dojo.query("*[id*='imgArray'])")[0].value
        ImgSource = arr.split("|");
    }

    dojo.addOnLoad(
     function () {
         setArray()
         dojo.query("*[id*='imgArray'])")[0].style.display = "none"
         displaynext();

     })

    function displaynext() {
        var divSelectedImage = dojo.query("*[id$='ImgSelectedEvent']")[0]
        if (currentIndex == ImgSource.length - 1)
            currentIndex = 0
        else
            currentIndex += 1

        divSelectedImage.src = ImgSource[currentIndex]
        setTimeout("displaynext()", 5000);
    }

    function goToGallery() {
        window.open("locali-divertimenti/GalleryImmaginiEventi.aspx")
    }
</script>
<div id="DivSelectedImage" onclick="goToGallery()">
    <asp:Image ID="ImgSelectedEvent" runat="server" CssClass="imgPrimaPagina" />
</div>
<asp:TextBox ID="imgArray" runat="server"></asp:TextBox>
